home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 5791-.end / dmg-6260 / articles / coding.doc < prev    next >
Text File  |  1993-06-25  |  14KB  |  247 lines

  1.          A COUPLE OF HOURS' WORTH OF A DEMO CODING SESSION
  2.         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.  
  4. Right. You have the  idea  (3D  sine-distorter),  you have the graphics
  5. (which took several attempts to  get  the  right palette), and you have
  6. the music (which took several re-loadings of STOS while trying to guess
  7. the right bloody offset!) All you need to do now is write the program.
  8.  
  9. First of all,  you  think  "I  know.  I  will  load  in  my demo shell,
  10. therefore making it easier to set about my demo." You eventually locate
  11. the correct disk with the file on, and  load  it in - only to find that
  12. you had accidentally saved a  recent  demo  (which used the shell) over
  13. it. You then spend  five  minutes  picking  out  and erasing individual
  14. lines, and clearing the memory banks.
  15.  
  16. Start again. First of  all,  you  attempt  to  write  the code for this
  17. amazing new distorter. After several minutes  of pulling your hair out,
  18. swearing, throwing disks about,  and  generally  behaving  like a drunk
  19. lord, you complete the code. Now  -  SAVE  the code. This is the clever
  20. bit. Once you get to this stage, ask yourself these questions:
  21.  
  22. i) Is there any space left on this disk? (likely answer: NO)
  23. ii) Have I got any other disks? (likely answer: YES, ONE. BUT NOT
  24.     FORMATTED)
  25. iii) Is there anywhere at all I can save this code? (YOU COULD TRY YOUR
  26.      HARD DRIVE)
  27. iv) Is my hard drive working? (likely answer: NO)
  28. v) Is there any way of formatting that disk without leaving STOS?
  29.    (YES, USE THAT FORMATTER YOU CAME ACROSS WHILE BROWSING THROUGH
  30.    ANOTHER OF THOSE DODGY SOURCE DISKS)
  31. vi) Does it work proporly? (likely answer: WHAT DO YOU THINK?)
  32.  
  33. Then, with great  hesitation,  switch  off  your  computer, format that
  34. disk, reformat that disk after finding out that you did it single-sided
  35. and not double-sided, then load STOS back  up  again. Go and make a cup
  36. of very, very strong coffee and a fag to help calm your nerves.
  37.  
  38. Now then. Load up the shell.  Curse  through  your teeth as you realise
  39. that you didn't save the  empty  demo  shell  after  ridding it of that
  40. other demo, and spend another  five  minutes clearing everything again.
  41. Save the bloody shell. "Error: Disk is write-protected." I DON'T BLOODY
  42. CARE, JUST SAVE THE BLOODY SHELL!
  43.  
  44. Computer commences to save  the  shell  on  a write-protected disk. You
  45. write enable the disk and save  it  yet  again,  so  as not to take any
  46. risks. RIGHT. Re-type all of that code again. Begin to lose temper when
  47. you realise how different it is from the other version. Carefully check
  48. this version, and feel satisfied that you must have been drunk when you
  49. typed the last version.
  50.  
  51. Save this code on your newly-formatted  disk  - eyeing the computer and
  52. daring it not  to  save  proporly.  It  saves  proporly  (you have also
  53. noticed that the computer has begun to panic slightly.)
  54.  
  55. Your trembling finger reaches for  F6  (run).  You close your eyes. You
  56. press the button, and hear a  faint  whirring sound. Your eyes fly open
  57. and you realise you were  so  nervous  that you accidentally pressed F5
  58. (save as) instead. Wait several seconds before you can click 'QUIT'.
  59. Now, with eyes open, press F6.
  60.  
  61. The screen clears, and you get what  seems  to resemble more of a cross
  62. between a map of Northern Carrick-on-Suir and a floating eyelid, than a
  63. 3D distorter. Press SPACE. Realise that you got the wrong HARDKEY code,
  64. and press RETURN. Still nothing happens. Commence to press every key on
  65. the keyboard, the mouse, the joystick, and the printer in an attempt to
  66. quit the demo proporly. Give up and press CONTROL - C instead.
  67.  
  68. List the offending lines and  exhale  deeply. If necessary, meditate or
  69. perform  light  Yoga  to  calm  nerves  and  protect  breakable  vases,
  70. ornaments, etc. from being  hurled  at  great  speed across the current
  71. room.
  72.  
  73. Check the code. Re-check the code. Check it again. Start reading  every
  74. single command  out  loud  so  you  can  detect  the  mistakes  better.
  75. Something along these lines may result: "RIGHT. 10 CLS. YES, CLS STANDS
  76. FOR CLEAR SCREEN, AND DOES JUST  THAT.  CLEVER ISN'T IT? NOW THEN, ONCE
  77. YOU HAVE CLEARED THE SCREEN  YOU  DOZY  COMPUTER,  YOU GO ONTO THE NEXT
  78. LINES, WHICH SAYS 20 CLICK OFF. OOH?  WHAT DOES CLICK OFF MEAN? AH YES!
  79. IT MEANS SWITCH OFF THE KEY CLICK..." (NB: Statements like these should
  80. be read very sarcastically indeed, as if to a mere child [or other less
  81. intelligent being])
  82.  
  83. Suddenly  realise  that  you  put  START(6)  instead  of  START(5)  and
  84. therefore the computer was trying to distort  part of the music and not
  85. your amazing new logo. Alter the mistake.  Save  the code YES I KNOW IT
  86. ALREADY EXISTS, JUST SAVE OVER IT. OH FOR GODS SAKE GET RID OF THE .BAK
  87. FILE IF THERE ISN'T ENOUGH SPACE!
  88.  
  89. Blush as your mother or other close  relative pokes his head around the
  90. door (if they are twins, they  would  DOKE  their head around the door,
  91. and if they were  quadruples,  they  would  LOKE  their head around the
  92. door...never mind!)
  93.  
  94. Once asked who the hell you are yelling at, just say you are trying out
  95. a new sample that you found lying  on  a coverdisk, and that the volume
  96. was up too high. (so what if it sounds exactly like me? - who doesn't?)
  97.  
  98. Inhale deepy (preferably with cigarette  between  teeth) and calm down.
  99. (Non-smokers should try more yoga.)
  100.  
  101. Save the program, and  run  it  again.  YES!  At  last,  you  have a 3D
  102. distorter on the screen. Next job -  set  up the paths for it to follow
  103. using complex mixtures  of  SINES  and  COSINES.  Spend several minutes
  104. testing out the  best  paths.  Realise  that  there  is  a syntax error
  105. somewhere on your
  106. =(SIN(RAD(T*3))*COS(RAD(T/2))/SIN(RAD(T))*COS(RAD(T*T))/SIN(RAD(2*SIN(
  107. RAD(T))) line and try and count how many brackets there are in case you
  108. have put too many or too little.
  109.  
  110. Spend even more time counting  again.  Swear  as  you find out that the
  111. brackets are right - you just  forgot  to  put SN(T)= at the beginning!
  112. Apologise to parent for swearing and  promise  never to do it again (at
  113. this rate, that would prove to be a most difficult task).
  114.  
  115. Time to summarise where we are. We have got the 3D distorter right. OK.
  116. Right. OK. Riiigghhht. (You are pretending  to sound like you know what
  117. to do next in a  hope  to  provide  self-encouragement. Instead you are
  118. making a prat out of yourself as your really good-looking sister who is
  119. at this very moment  outside  your  bedroom  door  is hearing this 'OK.
  120. RIGHT. OK. RIIIGHHT. NOW THEN.  OK.'  coming from somewhere inside your
  121. bedroom)
  122.  
  123. Tell your sister that you  keep  finding  these really wierd samples on
  124. coverdisks, and that you are  going  to  write  a complaint to put more
  125. decent stuff on (fat chance!)
  126.  
  127. Wait for sister to  go  away  before  rushing  downstairs, extracting a
  128. bottle of  highly-alcoholic  drink  from  your  grandad's  secret  army
  129. surplus 1942, and taking a big gulp.
  130.  
  131. [optional] cough, splutter, wheeze, and  puke  all  over the sofa in an
  132. attempt to control the alcohol (and what's left of your brain).
  133.  
  134. Stagger back upstairs, sit down,  light  up  another fag, and return to
  135. your demo. That quick swig, although  not doing your internal digestive
  136. system much good, has actually livened up your brain, and you now think
  137. you know what to do  next.  The  scroller.  This is another clever bit.
  138. First of all, you need your font.
  139.  
  140. Exit STOS. Yell out the strongest  swear  words in the Essex dictionary
  141. as you forgot to save your latest  version of source. Pay £150 fine for
  142. breach of peace and foul and  abusive  language. Return home from local
  143. nick the next day and make up some excuse to your mum that you went out
  144. with some friends last night, and slept around their house.
  145.  
  146. Return upstairs and collapse with despair into your programmer's chair.
  147. Promptly crash to floor as you forgot where said chair was (that Scotch
  148. Drambuie is still pretty much in effect).
  149.  
  150. Pick yourself up and gently  lower  yourself  into  said chair. Load up
  151. STOS. Wait for ages for your  many  extensions  to load in. Very gently
  152. curse as you forgot that you wanted  to load up your font disk instead.
  153. Reset machine. Sort through your disk boxes in a vain attempt to find a
  154. font disk. Curse (slightly louder  this  time)  as you realise that you
  155. must have formatted over them. Load up favourite art programme and draw
  156. out your own font (to add extra  tension  to this, you are not the best
  157. of artists).
  158.  
  159. Save picture. Realise that you had set  the snap to 33x33 and not 32x32
  160. and use the updated 'reduce' function of  the art program to reduce the
  161. font slightly  in  size.  Find  out  that  your  font  looks absolutely
  162. pathetic when it is reduced, and so draw the whole lot out again.
  163.  
  164. Save font. Load up STOS. Compact  font. Save compacted font. Load demo.
  165. Try desperately to remember what your demo  was about. RUN it to find a
  166. map of Carrick-on-Suir. Rack your rotting  brain - swearing to God that
  167. you had solved the problem only the previous day. Accidentally find out
  168. that you had inputted the wrong  screen  address  and make some sort of
  169. cheering noise. Shout to sister that you have actually scored a goal on
  170. KICK OFF 2, and are not losing sanity at all - in the slightest. Murmur
  171. to yourself that you doubt it, and set about making your scroll code.
  172.  
  173. Give up after several minutes  of  getting  little blocks of garbage to
  174. fly aimlessly around the screen (and  actually outside the border - but
  175. you didn't want to do  that).  Load  up  someone else's scroll code and
  176. change the variable names so noone can  check that it was their code in
  177. the first place.
  178.  
  179. Start writing scrolltext.  At  the  stage  your  mind  is  in, it would
  180. closeley resemble this:
  181.  
  182. 'AEGH89346N902G6 8356N2UM757(357Y416W5Y7/*6*2(ERC/9236B (W46(U7- *945.'
  183.  
  184. Write pages and pages of scrolltext. Run  demo and get last sentence of
  185. scroller. Realise that you put M$=  and  not M$=M$+ at the beginning of
  186. every line, and spend hours changing  each  one. Realise that you could
  187. have simply used the 'CHANGE' command and curse again.
  188.  
  189. Save the code. Next bit. The  flying  raster  bars.  Ho Ho this WILL be
  190. fun! Save six copies of  this  source  over different disks (not caring
  191. whether they are formatted or not).  Notice that you actually saved one
  192. of the copies on your dad's  favourite old 12-inch DES O'CONNER record.
  193. Look puzzled as you try to work  out  how  you managed to fit it in the
  194. drive. Receive pats on the back and  a fiver from your mother when your
  195. family realise that you get a  rather rhythmic blurple instead of DES's
  196. oh so wonderful tones the next time dad tries to play it.
  197.  
  198. Load in your  assembler  'raster'  routine  (shaking  and sweating) and
  199. start entering the colour codes, and  correctly setting up the data and
  200. address registers. Phone up local  computer  repair  shop and warn them
  201. that they might be needed pretty soon. Save the code. 'Sorry, sir?' Put
  202. the receiver down and stop thinking out loud. Save the code.
  203.  
  204. Look in mirror to see how pale  your face is. Creep downstairs and find
  205. a Sainsbury's carrier bag  and  between  thirty  and  fourty ice cubes.
  206. Place these ice cubes in the carrier  bag,  and balance the bag on your
  207. head (you will probably need some  string  to  tie  it to your head via
  208. your ears - should the bag decide not to stay put).
  209.  
  210. Walk upstairs, and straight into  your  sister.  Don't bother making up
  211. any excuses, just walk straight  into  your  bedroom and sit down. Tell
  212. her to GET LOST as she peeps around the door, looking worried.
  213.  
  214. Try to remember what was happening, and  why  you are shaking. Oh yes -
  215. you were just about to  try  out  the  raster  routine. Press F6. Get a
  216. message from nice Mr. Allan saying  that  if you don't register for the
  217. Missing-Link extension, he will not  bother making extensions any more.
  218. Promptly send nice Mr. Allan ten pounds, and run the program again.
  219.  
  220. The ST crashes. Well I never  did.  It  was as you expected, after all,
  221. who can possibly get a raster routine right first time? Shake your head
  222. to clear the list of names that has begun forming within.
  223.  
  224. Load STOS. Load demo. Check  over  your  code.  Realise that the raster
  225. routine uses the same timer as  the  wonderful STOS chip music you were
  226. using. Headbutt the wall  and  call  yourself  various  adult names for
  227. being so stupid as to use STOS music. BLOAD some Mad Max music instead.
  228. Look worried when you can't remember  whether  the  offset was 8 or 28.
  229. Just guess and press F6 - what the hell. You now get a rather good - if
  230. not slow - demo on the screen.
  231.  
  232. Say "I don't care - it's a demo" and compile it. Run the compiled demo.
  233. Computer crashes. Sit in silence trying to work out why the interpreter
  234. version worked when the  compiled  version  didn't. Eventually work out
  235. that the Compiler  accessory  being  loaded  in  must  have  offset and
  236. relocated the music bank elsewhere,  and  so  you  needed to reload the
  237. music in either after loading the accessory or after compilation.
  238.  
  239. Look puzzled as to where all of  that  bo**ocks came from and load STOS
  240. in again. Load the compiler first.  Load  your demo. Compile your demo.
  241. Load the music in again. Run  your  demo.  Find your demo still runs at
  242. twelve and a half Hertz, switch off computer, throw disk out of window,
  243. sit on and therefore  collapse  STOS  box  and  take  up Llama painting
  244. instead!
  245.  
  246. Article: BLACK EAGLE 25/6/93
  247.